package cn.zhp.service.impl;

import cn.zhp.entity.Examine;
import cn.zhp.mapper.ExamineMapper;
import cn.zhp.service.ExamineService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class ExamineServiceImpl extends BaseServiceImpl<Examine> implements ExamineService {


    @Autowired
    ExamineMapper examineMapper;  //从父类型BaseServiceImpl继承过来的 mapper是一个对象

    @Override
    public PageInfo<Examine> selectPage(int pageNum, int pageSize, Map<String,Object> params){
        PageHelper.startPage(pageNum,pageSize);//开启分页拦截

        List<Examine> examines = examineMapper.selectPage(params);

        return new PageInfo<Examine>(examines);
    }
}
